print("==================Init Ihome Env...===================")
require("ihome.env")
print("==================Done!===================")

print("==================Entity Start...===================")

local IS_DEBUG = true

local ihome = class("IHome", requrie("ihome.base.entity"))
local COMP_MAP = {
    wifi_ap = "ihome.compoments.wifiap", 
    wifi_sta = "ihome.compoments.wifista"
    mqtt = "ihome.compoments.mqtt", 
    smart_con = "ihome.compoments.smartcon"
}
function ihome:ctor()
    self.super.ctor(self)
    self:addCompoment(require(COMP_MAP["smart_con"]))
    self:addCompoment(require(COMP_MAP["wifi_sta"]))
end


-- --[[ 
--     1.连接wifi
--     2.处理ping|pong消息
--     3.文件
--  ]]

-- local function handle_wifi(nstep)
--     require("ihome.gate.wifistation"):on(
--         function()
--             print(wifi.sta.getip())
--             if type(nstep) == "function" then   
--                 nstep()
--             end
--         end
--      ):fail(
--         function()
--         end
--      )
-- end


-- local function handle_mqtt()
--     local mqtt = require("ihome.gate.alimqtt"):on(
--         function()
--             print("-->>>")
--         end
--         ):fail(
--         function()
--             print("--->>>")
--         end)
        
-- end

